package com.wedimob.slideshare.source;

public enum Source {
    SLIDESHARE(new SlideShareStrategy()),
    SCRIBD(new ScribdStrategy()),
    YOUTUBE(new YoutubeStrategy()),
    TED(null),
    DAILYMOTION(null);

    private SourceStrategy strategy;

    Source(SourceStrategy strategy) {
        this.strategy = strategy;
    }

    public SourceStrategy getStrategy() {
        return strategy;
    }

    public static int getNbPages(int limit, double itemPerPage) {
        return Math.max(1, (int) Math.ceil(limit / itemPerPage));
    }

}
